<%-- 
    Document   : viewDishDetail
    Created on : Feb 25, 2013, 9:29:32 PM
    Author     : Vrety
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Xem món ăn</title>
    </head>
    <body>
        <jsp:include page="homeHeader.jsp"/>
        <div align="center">
            <h1>Chi tiết món ăn!</h1>
            <c:choose>
                <c:when test="${empty sessionScope.viewDishDetail}">
                    <h2>Chưa chọn món ăn</h2>
                </c:when>
                <c:otherwise>
                        <c:forEach var="dish" items="${sessionScope.dishInfor}">
                             <b>  Tên món ăn: </b> ${dish.dishName} <br/>
                            <img alt=""  src="${pageContext.request.contextPath}/images/dish/${dish.imageURL}" width="200" height="200" /><br/>
                            <b>Hàm lượng calo:</b> ${dish.calories} <br/>
                            <c:forEach var="dishDetail" items="${sessionScope.viewDishDetail}">

                                <c:if test="${dishDetail.essential}">
                                    <b>Tên thực phẩm:</b> ${dishDetail.foodName}, số lượng: ${dishDetail.ammount} <br/>
                                </c:if>

                                <c:if test="${not dishDetail.essential}">
                                    <b>Tên thực phẩm:</b> ${dishDetail.foodName},  số lượng: ${dishDetail.ammount}<br/>
                                </c:if>

                            </c:forEach>
                            <b>Cách nấu ăn:</b> ${dish.cooking}<br/>
                            Tác giả: ${dish.userID}
                        </c:forEach>
                </c:otherwise>
            </c:choose>
        </div>
    </body>
</html>
